var http = require("http");
var url = require("url");

/**
 * 去除url参数word中的数字
 */
http.createServer(function(request, response) {  
  
    //text格式的resp 
    response.writeHead(200, {"Content-Type": "text/plain"});  
      
    //解析请求
    var params = url.parse(request.url, true).query;  
    var word = params.word; 
    console.log("user apply word: " + word);
    //去除数字
    var numReg = new RegExp("[0-9]+\\.?[0-9]*","g");
    var wordOut = "";
    if (word != null){
        wordOut = word.replace(numReg,"");
    }
    console.log("response word: " + wordOut);
    // 输出   
    response.write(wordOut);
    //结束resp
    response.end();    
    }).listen(1923);  
  
   
console.log("no number word server running...");